package com.rr.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * @author RR
 * @date 2023/1/18 17:54
 */
@Component
public class DiyGlobalFilter implements GlobalFilter {

    private static final Logger log = LoggerFactory.getLogger(DiyGlobalFilter.class);

    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        log.info("请求的路径" + exchange.getRequest().getURI());
        return chain.filter(exchange);
    }
}
